package com.titan.domain;

import java.io.Serializable;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: Ship
 *
 */
@Entity
public class Ship implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;
	private String name; 
	private int tonnage;
		
	@Column(unique=true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getTonnage() {
		return tonnage;
	}

	public void setTonnage(int tonnage) {
		this.tonnage = tonnage;
	}

	public Ship() {
		super();
	}
	
	@TableGenerator(name="SHIP_GENERATOR",
			table="GENERATOR_TABLE",
			pkColumnName="PRIMARY_KEY_COLUMN",
			valueColumnName="VALUE_COLUMN",
			pkColumnValue="SHIP_ID",
			allocationSize=5)
	
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="SHIP_GENERATOR")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
}
